/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.helpdesk.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Manuel
 */
@Entity
@Table(name = "hd_observaciones")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HdObservaciones.findAll", query = "SELECT h FROM HdObservaciones h"),
    @NamedQuery(name = "HdObservaciones.findByCodObservacion", query = "SELECT h FROM HdObservaciones h WHERE h.codObservacion = :codObservacion"),
    @NamedQuery(name = "HdObservaciones.findByDesObservacion", query = "SELECT h FROM HdObservaciones h WHERE h.desObservacion = :desObservacion"),
    @NamedQuery(name = "HdObservaciones.findByFecObservacion", query = "SELECT h FROM HdObservaciones h WHERE h.fecObservacion = :fecObservacion"), 
    @NamedQuery(name = "HdObservaciones.findBycodDetTicket", query = "SELECT h FROM HdObservaciones h WHERE h.codDetTicket = :codDetTicket")})
public class HdObservaciones implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.TABLE, generator="OBSERVACIONES")
    @TableGenerator(name="OBSERVACIONES", 
                    table="tbsequence",
                    pkColumnName="seq_name",
                    valueColumnName="seq_count")
    @Column(name = "COD_OBSERVACION", nullable=false)
    @Basic(optional = false)
    @NotNull
    private Integer codObservacion;
    @Size(max = 500)
    @Column(name = "DES_OBSERVACION")
    private String desObservacion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "FEC_OBSERVACION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecObservacion;
    @JoinColumn(name = "COD_DET_TICKET", referencedColumnName = "COD_DET_TICKET")
    @ManyToOne
    private HdDetalleTicket codDetTicket;

    public HdObservaciones() {
    }

    public HdObservaciones(Integer codObservacion) {
        this.codObservacion = codObservacion;
    }

    public HdObservaciones(Integer codObservacion, Date fecObservacion) {
        this.codObservacion = codObservacion;
        this.fecObservacion = fecObservacion;
    }

    public Integer getCodObservacion() {
        return codObservacion;
    }

    public void setCodObservacion(Integer codObservacion) {
        this.codObservacion = codObservacion;
    }

    public String getDesObservacion() {
        return desObservacion;
    }

    public void setDesObservacion(String desObservacion) {
        this.desObservacion = desObservacion;
    }

    public Date getFecObservacion() {
        return fecObservacion;
    }

    public void setFecObservacion(Date fecObservacion) {
        this.fecObservacion = fecObservacion;
    }

    public HdDetalleTicket getCodDetTicket() {
        return codDetTicket;
    }

    public void setCodDetTicket(HdDetalleTicket codDetTicket) {
        this.codDetTicket = codDetTicket;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codObservacion != null ? codObservacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HdObservaciones)) {
            return false;
        }
        HdObservaciones other = (HdObservaciones) object;
        if ((this.codObservacion == null && other.codObservacion != null) || (this.codObservacion != null && !this.codObservacion.equals(other.codObservacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.helpdesk.entidades.HdObservaciones[ codObservacion=" + codObservacion + " ]";
    }
    
}
